home *** CD-ROM | disk | FTP | other *** search
- Path: news.clark.net!usenet
- From: gusty@clark.net (Harlan Messinger)
- Newsgroups: comp.lang.c++
- Subject: Re: class INTERFACE declaration ??
- Date: Sun, 28 Jan 1996 19:39:06 GMT
- Organization: Clark Internet Services, Inc.
- Message-ID: <4egjeh$j3f@clarknet.clark.net>
- References: <310C267F.78BC@pi.net>
- NNTP-Posting-Host: gusty-ppp.clark.net
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=ISO-8859-1
- Content-Transfer-Encoding: 8bit
- X-Newsreader: Forte Free Agent 1.0.82
-
- heggie <heggie@pi.net> wrote:
-
- >I'm trying to implement a Date class who exists
- >of three int fields and some interfaces, with the
- >last thing i'm having some problems
- >(ps using borlands c++ for windows)
- >I can't think of a reason why the interface declaration
- >of setdate is wrong, anybody outhere maybe????
-
- >THANKs in advantage,
-
- >#include <stdio.h>
- >#include <stdlib.h>
- >#include <string.h>
- >#include <iostream.h>
-
- >class Date
- >{
- > public:
- > void setdate (int d, int m, int y);
- > void printdate ();
- > void nextday();
-
- > private:
- > int
- > day,
- > month,
- > year;
- >}
-
- The trouble is here. You need a semicolon after the closing brace of
- the class definition.
-
- >void Date::setdate (int d, int m, int y)
- >{
- >.........
- >}
-
- >************************************************
- >Compiling ..\SOURCES\OPDR_48.CPP:
- >Error ..\SOURCES\OPDR_48.CPP 21: Too many types in declaration
- >Error ..\SOURCES\OPDR_48.CPP 22: Type 'Date' may not be defined here
- >Error ..\SOURCES\OPDR_48.CPP 22: 'Date::setdate(int,int,int)' is not a
- >member of 'Date'
-
-
-